<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/2/7
  Time: 20:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/materialdesignicons.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/style.min.css" rel="stylesheet">
</head>

<body>
<div class="container-fluid p-t-15">

    <div class="row">
        <div class="col-sm-6 col-md-4">
            <div class="card bg-primary">
                <div class="card-body clearfix">
                    <div class="pull-right">
                        <p class="h6 text-white m-t-0">用户数量</p>
                        <p class="h3 text-white m-b-0 fa-1-5x" id="studentNum"></p>
                    </div>
                    <div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-account fa-1-5x"></i></span> </div>
                </div>
            </div>
        </div>

        <div class="col-sm-6 col-md-4">
            <div class="card bg-danger">
                <div class="card-body clearfix">
                    <div class="pull-right">
                        <p class="h6 text-white m-t-0">座位数量</p>
                        <p class="h3 text-white m-b-0 fa-1-5x" id="seatNum"></p>
                    </div>
                    <div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-chair-school fa-1-5x"></i></span> </div>
                </div>
            </div>
        </div>



        <div class="col-sm-6 col-md-4">
            <div class="card bg-purple">
                <div class="card-body clearfix">
                    <div class="pull-right">
                        <p class="h6 text-white m-t-0">公告数量</p>
                        <p class="h3 text-white m-b-0 fa-1-5x" id="messNum"></p>
                    </div>
                    <div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-comment-outline fa-1-5x"></i></span> </div>
                </div>
            </div>
        </div>
    </div>


</div>

<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/main.min.js"></script>

<!--图表插件-->
<script type="text/javascript" src="${pageContext.request.contextPath}/js/Chart.js"></script>
<script type="text/javascript">
    //页面初始化
    $(document).ready(function(e) {
        //学生数
        $.ajax({
            type: "get",
            url:"/student/getCount.action",
            dataType:"json",
            success:function (message) {
                $("#studentNum").html(message.count)
            }
        })
        //座位数
        $.ajax({
            type: "post",
            url:"/seat/getCount.action",
            data:{},
            dataType:"json",
            success:function (message) {
                $("#seatNum").html(message.count)
            }
        })
        //公告数量
        $.ajax({
            type: "post",
            url:"/message/getCount.action",
            data:{},
            dataType:"json",
            success:function (message) {
                $("#messNum").html(message.count)
            }
        })
    });
</script>
</body>
</html>
